import QtQuick 2.0
import QtQuick.Controls 2.5
import SvgImage 1.0

Button {
    id: root
    implicitWidth: 32
    implicitHeight: 32
    opacity: enabled ? 1 : 0.5
    hoverEnabled: true

    property string source_normal: ""
    property string source_hover: ""
    property string source_pressed: ""
    property string source_disable: ""

    background: Rectangle {
        color: "transparent"

        SvgImage {
            id: iconImage
            anchors.fill: parent
            source: source_normal
        }
    }

    onPressed: { iconImage.source = source_pressed }
    onReleased: { iconImage.source = source_hover }
    onHoveredChanged: { iconImage.source = hovered ? source_hover : source_normal }
}
